<?php
class Admin_Form_AddArea extends Apps_Form {
	public function init() {
		$tbCountry = new M_DbTable_Country();
		$country = new Zend_Form_Element_Select(
				'country_id',
				array('label'  			=> 'Country',
					  'required'		=> true,
					  'multiOptions' 	=> M_Tool_DataMapper::getInstance()->mapKeyValue($tbCountry->getList(), 'id', 'en_name')));

		$title = new Zend_Form_Element_Text(
				'name',
				array('label' 		=> 'Area name (Vi)',
					'filters'		=> array('StringTrim')));

		$enTitle = new Zend_Form_Element_Text(
				'en_name',
				array('label' 		=> 'Area name (En)',
					  'required'	=> true, 
					  'filters'		=> array('StringTrim')));
		
		$sortingNumber = new Zend_Form_Element_Text(
				'sorting_number',
				array('label'      => 'Sorting number',
						'class'      => 'input-mini'));

		$description = new Zend_Form_Element_Textarea(
				'description',
				array('label' => 'Description',
					  'cols'	=> 80));

		$this->setLegend('Add New');
		$this->addElement($country)
			 ->addElement($enTitle)
			 ->addElement($title)
			 ->addElement($sortingNumber)
			 ->addElement($description);

		$this->addActionGroup()
			 ->makeup();
	}
}